#ifndef RINGBUF_H__
#define RINGBUF_H__

typedef int Datatype;

typedef struct ringbuf{
	Datatype data;
	struct ringbuf *next;
}RINGB;

// typedef struct nowpoint{
	

// 	RINGB *now;
// }NOWPT;

typedef struct allpoint{
	RINGB *pread;
	RINGB *pwrite;
	int length;
}ALLPT;

ALLPT *Ringbuf_init(RINGB **,ALLPT *,int );

int Ringbuf_write(ALLPT *,Datatype *,int);

int Ringbuf_read(ALLPT *,Datatype *,int );

void* My_memcpy(void* dest,const void* src, size_t num);

int Ringbuf_datalen(ALLPT *);

void Ringbuf_free(RINGB *);

void Ringbuf_display(ALLPT *);


#endif